/**
 * Copyright (C), 2019-2020, 宇信融汇
 * FileName: Order
 * Author:   666
 * Date:     2020/7/27 22:53
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 666           修改时间           版本号              描述
 */
package c_010.generic;

import java.util.ArrayList;
import java.util.List;

/**
 * @Classname Order
 * @Description TODO
 * @Date 2020/7/27 22:53
 * @Created by 666
 */
public class Order <T>{
    private String name;
    private int age;
    T orderT;

    public Order() {
    }

    public Order(String name, int age, T orderT) {
        this.name = name;
        this.age = age;
        this.orderT = orderT;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public T getOrderT() {
        return orderT;
    }

    public void setOrderT(T orderT) {
        this.orderT = orderT;
    }

    public  <E> List<E> comyFromArrayList(E[] arr){
        ArrayList<E> list = new ArrayList<>();
        for(E e:arr){
            list.add(e);
        }
        return list;
    }

    @Override
    public String toString() {
        return "Order{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", orderT=" + orderT +
                '}';
    }

    public <E> List<E> copyFromArrayList(E[] arr) {
        ArrayList<E> list = new ArrayList<>();
        for (E e : arr) {
            list.add(e);
        }
        return list;

    }
}
